import {requestDel, requestGet, requestPatch, requestPost} from "./request";

const url = '/broadcast-schedule/'

//channel, start_crontab, end_crontab, schedule_type
export async function postBroadCast(broadcast) {
  return await requestPost(url, broadcast)
}

export async function getBroadCast({channelId, schedule_type}) {
  return await requestGet(url, {channel: channelId, schedule_type})
}

export async function patchBroadCast(broadcast) {
  return await requestPatch(`${url}${broadcast.id}/`, broadcast)
}

export async function deleteBroadCase(id) {
  return await requestDel(`${url}${id}`)
}
